package com.niiwoo.activity.event.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by dengyunhui on 2018/03/21.
 */
@AllArgsConstructor
@Getter
public enum ProjectTypeEnum {

    SPEED(Byte.valueOf("1"), "极速借个人"),
    ORG_SPEEDLOAN(Byte.valueOf("2"), "极速借机构"),
    NIIWOO_CLOUD_LOAN(Byte.valueOf("3"), "你我云贷"),
    CARD(Byte.valueOf("4"), "卡易借"),

    XINYONG((byte) -4, "信用借"),  //老系统遗留：4 ————> -4
    QIAOQIAOJIE((byte) -5, "悄悄借"),  //老系统遗留：5 ————> -5
    CASHCAR((byte) -6, "现金动车"), //老系统遗留：6 ————> -6

    SMALL_LOAN((byte) 8, "小易借"),
    SOCIAL_SECURITY_LOAN((byte) 9, "社保借"),
    CREDIT_CARD_LOAN((byte) 10, "信用卡借"),
	
    ORG_SPEEDLOAN_NEW((byte) 11, "极速借机构(新)"), // 新极速借机构类型
    DECORATION_LOAN((byte) 12, "装修借"),
    CONSUME_LOAN((byte) 14, "消费贷");//13已被债权标占用

    private Byte code;
    private String desc;

    public static ProjectTypeEnum valueOf(Byte code) {
        for (ProjectTypeEnum projectTypeEnum : ProjectTypeEnum.values()) {
            if (code.byteValue() == projectTypeEnum.getCode()) {
                return projectTypeEnum;
            }
        }
        return null;
    }
}
